﻿namespace WinForms.ControlList.Guest
{
    using Bll.Guest;
    using Bll.Systems;
    using Library;
    using Model.Guest;
    using Model.Systems;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.Properties;

    public class FrmGuestSelect : Form
    {
        private Button btn_Close;
        private Button btn_Select;
        private Button btnSearch;
        private Button btnSearchHidden;
        private DataGridViewCheckBoxColumn chk_chkItem;
        private IContainer components = null;
        private DataGridViewTextBoxColumn ConsumeNum;
        private DataGridViewTextBoxColumn CumulativeMoney;
        private DataGridView DataGridList;
        private DataGridViewTextBoxColumn dgAddresses;
        private DataGridViewTextBoxColumn dgBankName;
        private DataGridViewTextBoxColumn dgBankNum;
        private DataGridViewTextBoxColumn dgBirthday;
        private DataGridViewTextBoxColumn dgChainNum;
        private DataGridViewTextBoxColumn dgClearingType;
        private DataGridViewTextBoxColumn dgConsumeNum;
        private DataGridViewTextBoxColumn dgCreateMan;
        private DataGridViewTextBoxColumn dgCumulativeMoney;
        private DataGridViewTextBoxColumn dgGuestId;
        private DataGridViewTextBoxColumn dgGuestName;
        private DataGridViewTextBoxColumn dgGuestTypeId;
        private DataGridViewTextBoxColumn dgGuestTypes;
        private DataGridViewTextBoxColumn dgIsPrivacy;
        private DataGridViewTextBoxColumn dgMaxMoney;
        private DataGridViewTextBoxColumn dgOtherTel;
        private DataGridViewTextBoxColumn dgOutstMoney;
        private DataGridViewTextBoxColumn dgPaidMoney;
        private DataGridViewTextBoxColumn dgPayType;
        private DataGridViewTextBoxColumn dgRemark;
        private DataGridViewTextBoxColumn dgSex;
        private DataGridViewTextBoxColumn dgTel;
        private DataGridViewTextBoxColumn dgTIN;
        private DataGridViewTextBoxColumn dgUpdateTime;
        private DataGridViewTextBoxColumn dgWangWangNum;
        private ComboBox drp_GuestGrade;
        private ComboBox drp_GuestType;
        private DataGridViewTextBoxColumn GuestId;
        private DataGridViewTextBoxColumn GuestName;
        private DataGridViewTextBoxColumn GuestTypeId;
        private DataGridViewTextBoxColumn GuestTypes;
        public const int HTCAPTION = 2;
        private DataGridViewImageColumn imgDelete;
        private DataGridViewImageColumn imgEdit;
        private Label label1;
        private Label lbl_GuestGradeType;
        private Label lbl_GuestName;
        private Label lbl_GuestType;
        private Label lbl_Moble;
        private Label lblWhere;
        private Navigator navigator_Page;
        private DataGridViewTextBoxColumn OutstMoney;
        private DataGridViewTextBoxColumn PaidMoney;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Top;
        private Panel pan_TopJianGe;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel1;
        private Panel panel10;
        private Panel panel101;
        private Panel panel11;
        private Panel panel12;
        private Panel panel13;
        private Panel panel16;
        private Panel panel17;
        private Panel panel18;
        private Panel panel19;
        private Panel panel2;
        private Panel panel20;
        private Panel panel21;
        private Panel panel22;
        private Panel panel23;
        private Panel panel3;
        private Panel panel6;
        private Panel panel7;
        private Panel panel8;
        private Panel panel9;
        private Panel panel91;
        private DataGridViewTextBoxColumn PayType;
        private Panel PlSearch;
        public const int SC_MOVE = 0xf010;
        public GuestEnt selectGuest = null;
        private DataGridViewTextBoxColumn Tel;
        private TextBox txt_GuestName;
        private TextBox txt_Moble;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmGuestSelect()
        {
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.DataGridList.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.DataGridList.MultiSelect = false;
            this.DataGridList.Select();
            base.AcceptButton = this.btn_Select;
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btn_Select_Click(object sender, EventArgs e)
        {
            string selectId = this.GetSelectId(1);
            if ((selectId != null) && (selectId != ""))
            {
                this.selectGuest = GuestBll.GetModel(int.Parse(selectId));
                if (this.selectGuest != null)
                {
                    base.DialogResult = DialogResult.OK;
                    base.Close();
                }
            }
        }

        private void btnChongAll_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.DataGridList.Rows.Count; i++)
            {
                this.DataGridList.Rows[i].Cells[0].Value = "False";
            }
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            this.lblWhere.Text = " where 1=1 ";
            if (this.txt_GuestName.Text != "")
            {
                this.lblWhere.Text = this.lblWhere.Text + " and GuestName like '%" + this.txt_GuestName.Text + "%'";
            }
            if (this.txt_Moble.Text != "")
            {
                this.lblWhere.Text = this.lblWhere.Text + " and tel like '%" + this.txt_GuestName.Text + "%'";
            }
            if ((this.drp_GuestType.Text != "请选择") && (this.drp_GuestType.Text != ""))
            {
                if (this.drp_GuestType.Text == "个人")
                {
                    this.lblWhere.Text = this.lblWhere.Text + " and GuestTypes=1 ";
                }
                else
                {
                    this.lblWhere.Text = this.lblWhere.Text + " and GuestTypes=2 ";
                }
            }
            if ((this.drp_GuestGrade.Text != "请选择") && (this.drp_GuestGrade.Text != ""))
            {
                this.lblWhere.Text = this.lblWhere.Text + " and GuestTypeId=" + ((ComboxItem) this.drp_GuestGrade.SelectedItem).Value.ToString();
            }
            this.DataGrid_bind();
        }

        private void btnSearchHidden_Click(object sender, EventArgs e)
        {
            if (this.PlSearch.Visible)
            {
                this.btnSearchHidden.Text = "显示查询";
                this.PlSearch.Visible = false;
            }
            else
            {
                this.btnSearchHidden.Text = "隐藏查询";
                this.PlSearch.Visible = true;
            }
        }

        private void btnSelectAll_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.DataGridList.Rows.Count; i++)
            {
                if (this.DataGridList.Rows[i].Cells[0].FormattedValue.ToString() == "True")
                {
                    this.DataGridList.Rows[i].Cells[0].Value = "False";
                }
                else
                {
                    this.DataGridList.Rows[i].Cells[0].Value = "True";
                }
            }
        }

        protected void DataGrid_bind()
        {
            try
            {
                DataTable dt = new DataTable();
                int pageCurrent = this.navigator_Page.PageCurrent;
                if (this.lblWhere.Text != "")
                {
                    dt = GuestBll.GetPageList(PublicAppliction.PageCount, pageCurrent, this.lblWhere.Text);
                }
                else
                {
                    dt = GuestBll.GetPageList(PublicAppliction.PageCount, pageCurrent, "");
                }
                int num2 = GetTableColCount.ReturnTableColCount("Systems", "T_Guest", this.lblWhere.Text);
                this.DataGridList.AutoGenerateColumns = false;
                this.DataZhuanHuan(ref dt);
                this.DataGridList.DataSource = dt;
                this.navigator_Page.DataSource = dt;
                this.navigator_Page.RowCount = num2;
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }

        private void DataGridList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                string s = this.DataGridList.Rows[e.RowIndex].Cells[1].Value.ToString();
                if (s != null)
                {
                    this.selectGuest = GuestBll.GetModel(int.Parse(s));
                    base.DialogResult = DialogResult.OK;
                    base.Close();
                }
            }
        }

        private void DataGridList_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            this.DataGridList.Rows[e.RowIndex].Cells[0].Value = true;
        }

        private void DataGridList_RowLeave(object sender, DataGridViewCellEventArgs e)
        {
            this.DataGridList.Rows[e.RowIndex].Cells[0].Value = false;
        }

        protected void DataZhuanHuan(ref DataTable dt)
        {
            dt.Columns["GuestTypes"].ColumnName = "GuestTypes1";
            dt.Columns["GuestTypeId"].ColumnName = "GuestTypeId1";
            dt.Columns["PayType"].ColumnName = "PayType1";
            dt.Columns["ClearingType"].ColumnName = "ClearingType1";
            dt.Columns.Add("GuestTypes");
            dt.Columns.Add("GuestTypeId");
            dt.Columns.Add("PayType");
            dt.Columns.Add("ClearingType");
            foreach (DataRow row in dt.Rows)
            {
                if (row["GuestTypes1"].ToString() == "1")
                {
                    row["GuestTypes"] = "个人";
                }
                else
                {
                    row["GuestTypes"] = "公司";
                }
                try
                {
                    DataRow[] rowArray = PublicAppliction.GuestGradeDt.Select("GuestTypeId=" + row["GuestTypeId1"].ToString() + "");
                    if (rowArray.Length > 0)
                    {
                        row["GuestTypeId"] = rowArray[0]["GuestName"].ToString();
                    }
                }
                catch (Exception)
                {
                    row["GuestTypeId"] = "无";
                }
                DataRow[] rowArray2 = PublicAppliction.ParDt.Select("parid=" + row["PayType1"].ToString() + "");
                if (rowArray2.Length > 0)
                {
                    row["PayType"] = rowArray2[0]["parname"].ToString();
                }
                DataRow[] rowArray3 = PublicAppliction.ParDt.Select("parid=" + row["ClearingType1"].ToString() + "");
                if (rowArray3.Length > 0)
                {
                    row["ClearingType"] = rowArray3[0]["parname"].ToString();
                }
            }
            dt.Columns.Remove("GuestTypes1");
            dt.Columns.Remove("GuestTypeId1");
            dt.Columns.Remove("PayType1");
            dt.Columns.Remove("ClearingType1");
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmGuestList_Load(object sender, EventArgs e)
        {
            this.DataGrid_bind();
            this.InitPage();
            this.drp_GuestType.SelectedIndex = 0;
            this.drp_GuestGrade.Items.Clear();
            UserEnt loginUser = PublicAppliction.LoginUser;
            this.drp_GuestGrade.DisplayMember = "Name";
            this.drp_GuestGrade.ValueMember = "Value";
            DataTable list = GuestGradeBll.GetList("chainNum=" + loginUser.ChainNum);
            this.drp_GuestGrade.Items.Add(new ComboxItem("请选择", ""));
            foreach (DataRow row in list.Rows)
            {
                this.drp_GuestGrade.Items.Add(new ComboxItem(row["GuestName"].ToString(), row["GuestTypeId"].ToString()));
            }
            if (list.Rows.Count > 0)
            {
                this.drp_GuestGrade.SelectedIndex = 0;
            }
        }

        private string GetSelectId(int types)
        {
            string str;
            int num;
            if (types == 0)
            {
                str = "";
                for (num = 0; num < this.DataGridList.Rows.Count; num++)
                {
                    if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                    {
                        str = str + this.DataGridList.Rows[num].Cells[1].Value + ",";
                    }
                }
                return str;
            }
            int num2 = 0;
            str = "";
            for (num = 0; num < this.DataGridList.Rows.Count; num++)
            {
                if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                {
                    str = str + this.DataGridList.Rows[num].Cells[1].Value + ",";
                    num2++;
                }
            }
            if (num2 > 1)
            {
                MessageBox.Show("只能选择一项", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return "";
            }
            return str.Replace(",", "");
        }

        private void InitializeComponent()
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            DataGridViewCellStyle style12 = new DataGridViewCellStyle();
            DataGridViewCellStyle style13 = new DataGridViewCellStyle();
            DataGridViewCellStyle style14 = new DataGridViewCellStyle();
            DataGridViewCellStyle style15 = new DataGridViewCellStyle();
            DataGridViewCellStyle style16 = new DataGridViewCellStyle();
            this.panel1 = new Panel();
            this.panel7 = new Panel();
            this.btnSearch = new Button();
            this.panel6 = new Panel();
            this.btnSearchHidden = new Button();
            this.panel3 = new Panel();
            this.panel2 = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.DataGridList = new DataGridView();
            this.chk_chkItem = new DataGridViewCheckBoxColumn();
            this.GuestId = new DataGridViewTextBoxColumn();
            this.GuestTypes = new DataGridViewTextBoxColumn();
            this.GuestTypeId = new DataGridViewTextBoxColumn();
            this.GuestName = new DataGridViewTextBoxColumn();
            this.PayType = new DataGridViewTextBoxColumn();
            this.Tel = new DataGridViewTextBoxColumn();
            this.CumulativeMoney = new DataGridViewTextBoxColumn();
            this.PaidMoney = new DataGridViewTextBoxColumn();
            this.OutstMoney = new DataGridViewTextBoxColumn();
            this.ConsumeNum = new DataGridViewTextBoxColumn();
            this.imgEdit = new DataGridViewImageColumn();
            this.imgDelete = new DataGridViewImageColumn();
            this.PlSearch = new Panel();
            this.panel20 = new Panel();
            this.drp_GuestType = new ComboBox();
            this.panel21 = new Panel();
            this.lbl_GuestType = new Label();
            this.panel18 = new Panel();
            this.drp_GuestGrade = new ComboBox();
            this.panel19 = new Panel();
            this.lbl_GuestGradeType = new Label();
            this.panel16 = new Panel();
            this.txt_Moble = new TextBox();
            this.panel17 = new Panel();
            this.lbl_Moble = new Label();
            this.panel22 = new Panel();
            this.txt_GuestName = new TextBox();
            this.panel23 = new Panel();
            this.lbl_GuestName = new Label();
            this.panel13 = new Panel();
            this.panel10 = new Panel();
            this.panel12 = new Panel();
            this.lblWhere = new Label();
            this.panel11 = new Panel();
            this.navigator_Page = new Navigator();
            this.panel91 = new Panel();
            this.panel101 = new Panel();
            this.btn_Close = new Button();
            this.btn_Select = new Button();
            this.panel9 = new Panel();
            this.panel8 = new Panel();
            this.pan_TopJianGe = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_DockLeft = new Panel();
            this.label1 = new Label();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.panel1.SuspendLayout();
            this.panel7.SuspendLayout();
            this.panel6.SuspendLayout();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            ((ISupportInitialize) this.DataGridList).BeginInit();
            this.PlSearch.SuspendLayout();
            this.panel20.SuspendLayout();
            this.panel21.SuspendLayout();
            this.panel18.SuspendLayout();
            this.panel19.SuspendLayout();
            this.panel16.SuspendLayout();
            this.panel17.SuspendLayout();
            this.panel22.SuspendLayout();
            this.panel23.SuspendLayout();
            this.panel10.SuspendLayout();
            this.panel12.SuspendLayout();
            this.panel11.SuspendLayout();
            this.panel101.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.panel1.BackColor = Color.FromArgb(0xf6, 0xf6, 0xf6);
            this.panel1.Controls.Add(this.panel7);
            this.panel1.Controls.Add(this.panel6);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Dock = DockStyle.Top;
            this.panel1.Location = new Point(0, 8);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x367, 0x1a);
            this.panel1.TabIndex = 1;
            this.panel7.Controls.Add(this.btnSearch);
            this.panel7.Dock = DockStyle.Right;
            this.panel7.Location = new Point(0x2b5, 3);
            this.panel7.Name = "panel7";
            this.panel7.Size = new Size(0x59, 20);
            this.panel7.TabIndex = 13;
            this.btnSearch.Dock = DockStyle.Right;
            this.btnSearch.Location = new Point(14, 0);
            this.btnSearch.Name = "btnSearch";
            this.btnSearch.Size = new Size(0x4b, 20);
            this.btnSearch.TabIndex = 1;
            this.btnSearch.Text = "查 询";
            this.btnSearch.UseVisualStyleBackColor = true;
            this.btnSearch.Click += new EventHandler(this.btnSearch_Click);
            this.panel6.Controls.Add(this.btnSearchHidden);
            this.panel6.Dock = DockStyle.Right;
            this.panel6.Location = new Point(0x30e, 3);
            this.panel6.Name = "panel6";
            this.panel6.Size = new Size(0x59, 20);
            this.panel6.TabIndex = 12;
            this.btnSearchHidden.Dock = DockStyle.Right;
            this.btnSearchHidden.Location = new Point(14, 0);
            this.btnSearchHidden.Name = "btnSearchHidden";
            this.btnSearchHidden.Size = new Size(0x4b, 20);
            this.btnSearchHidden.TabIndex = 0;
            this.btnSearchHidden.Text = "显示查询";
            this.btnSearchHidden.UseVisualStyleBackColor = true;
            this.btnSearchHidden.Click += new EventHandler(this.btnSearchHidden_Click);
            this.panel3.Dock = DockStyle.Bottom;
            this.panel3.Location = new Point(0, 0x17);
            this.panel3.Name = "panel3";
            this.panel3.Size = new Size(0x367, 3);
            this.panel3.TabIndex = 1;
            this.panel2.Dock = DockStyle.Top;
            this.panel2.Location = new Point(0, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new Size(0x367, 3);
            this.panel2.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x37d, 0x201);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(0x37b, 0x200);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.DataGridList);
            this.pan_AllPlanes.Controls.Add(this.PlSearch);
            this.pan_AllPlanes.Controls.Add(this.panel13);
            this.pan_AllPlanes.Controls.Add(this.panel10);
            this.pan_AllPlanes.Controls.Add(this.panel91);
            this.pan_AllPlanes.Controls.Add(this.panel101);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Controls.Add(this.panel8);
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.pan_TopJianGe);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(0x367, 0x1ec);
            this.pan_AllPlanes.TabIndex = 4;
            this.DataGridList.AllowUserToAddRows = false;
            this.DataGridList.AllowUserToDeleteRows = false;
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridList.AlternatingRowsDefaultCellStyle = style;
            this.DataGridList.BackgroundColor = Color.WhiteSmoke;
            this.DataGridList.BorderStyle = BorderStyle.None;
            style2.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style2.BackColor = Color.White;
            style2.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style2.ForeColor = SystemColors.WindowText;
            style2.SelectionBackColor = SystemColors.Highlight;
            style2.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.ColumnHeadersDefaultCellStyle = style2;
            this.DataGridList.Columns.AddRange(new DataGridViewColumn[] { this.chk_chkItem, this.GuestId, this.GuestTypes, this.GuestTypeId, this.GuestName, this.PayType, this.Tel, this.CumulativeMoney, this.PaidMoney, this.OutstMoney, this.ConsumeNum, this.imgEdit, this.imgDelete });
            style3.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridList.DefaultCellStyle = style3;
            this.DataGridList.Dock = DockStyle.Fill;
            this.DataGridList.EnableHeadersVisualStyles = false;
            this.DataGridList.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridList.Location = new Point(0, 0x45);
            this.DataGridList.Name = "DataGridList";
            style4.Alignment = DataGridViewContentAlignment.BottomCenter;
            style4.BackColor = Color.White;
            style4.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.RowHeadersDefaultCellStyle = style4;
            style5.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridList.RowsDefaultCellStyle = style5;
            this.DataGridList.RowTemplate.Height = 0x17;
            this.DataGridList.Size = new Size(0x367, 0x15d);
            this.DataGridList.TabIndex = 8;
            this.DataGridList.CellLeave += new DataGridViewCellEventHandler(this.DataGridList_RowLeave);
            this.DataGridList.CellDoubleClick += new DataGridViewCellEventHandler(this.DataGridList_CellDoubleClick);
            this.DataGridList.CellEnter += new DataGridViewCellEventHandler(this.DataGridList_RowEnter);
            style6.NullValue = false;
            this.chk_chkItem.DefaultCellStyle = style6;
            this.chk_chkItem.HeaderText = "选项";
            this.chk_chkItem.IndeterminateValue = "";
            this.chk_chkItem.Name = "chk_chkItem";
            this.chk_chkItem.Width = 50;
            this.chk_chkItem.FalseValue = "false";
            this.chk_chkItem.TrueValue = "true";
            this.GuestId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.GuestId.DataPropertyName = "GuestId";
            style7.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style7.BackColor = Color.White;
            this.GuestId.DefaultCellStyle = style7;
            this.GuestId.HeaderText = "客户id";
            this.GuestId.Name = "GuestId";
            this.GuestId.ReadOnly = true;
            this.GuestId.Visible = false;
            this.GuestTypes.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.GuestTypes.DataPropertyName = "GuestTypes";
            style8.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style8.BackColor = Color.White;
            this.GuestTypes.DefaultCellStyle = style8;
            this.GuestTypes.HeaderText = "客户类型";
            this.GuestTypes.Name = "GuestTypes";
            this.GuestTypes.ReadOnly = true;
            this.GuestTypeId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.GuestTypeId.DataPropertyName = "GuestTypeId";
            style9.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style9.BackColor = Color.White;
            this.GuestTypeId.DefaultCellStyle = style9;
            this.GuestTypeId.HeaderText = "客户折扣类型";
            this.GuestTypeId.Name = "GuestTypeId";
            this.GuestTypeId.ReadOnly = true;
            this.GuestName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.GuestName.DataPropertyName = "GuestName";
            style10.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style10.BackColor = Color.White;
            this.GuestName.DefaultCellStyle = style10;
            this.GuestName.HeaderText = "名称";
            this.GuestName.Name = "GuestName";
            this.GuestName.ReadOnly = true;
            this.PayType.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.PayType.DataPropertyName = "PayType";
            style11.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style11.BackColor = Color.White;
            this.PayType.DefaultCellStyle = style11;
            this.PayType.HeaderText = "常用付款方式";
            this.PayType.Name = "PayType";
            this.PayType.ReadOnly = true;
            this.Tel.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.Tel.DataPropertyName = "Tel";
            style12.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style12.BackColor = Color.White;
            this.Tel.DefaultCellStyle = style12;
            this.Tel.HeaderText = "联系电话";
            this.Tel.Name = "Tel";
            this.Tel.ReadOnly = true;
            this.CumulativeMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CumulativeMoney.DataPropertyName = "CumulativeMoney";
            style13.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style13.BackColor = Color.White;
            this.CumulativeMoney.DefaultCellStyle = style13;
            this.CumulativeMoney.HeaderText = "累计总金额";
            this.CumulativeMoney.Name = "CumulativeMoney";
            this.CumulativeMoney.ReadOnly = true;
            this.PaidMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.PaidMoney.DataPropertyName = "PaidMoney";
            style14.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style14.BackColor = Color.White;
            this.PaidMoney.DefaultCellStyle = style14;
            this.PaidMoney.HeaderText = "已付总金额";
            this.PaidMoney.Name = "PaidMoney";
            this.PaidMoney.ReadOnly = true;
            this.OutstMoney.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.OutstMoney.DataPropertyName = "OutstMoney";
            style15.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style15.BackColor = Color.White;
            this.OutstMoney.DefaultCellStyle = style15;
            this.OutstMoney.HeaderText = "未付总金额";
            this.OutstMoney.Name = "OutstMoney";
            this.OutstMoney.ReadOnly = true;
            this.ConsumeNum.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.ConsumeNum.DataPropertyName = "ConsumeNum";
            style16.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style16.BackColor = Color.White;
            this.ConsumeNum.DefaultCellStyle = style16;
            this.ConsumeNum.HeaderText = "消费次数";
            this.ConsumeNum.Name = "ConsumeNum";
            this.ConsumeNum.ReadOnly = true;
            this.imgEdit.HeaderText = "编辑";
            this.imgEdit.Image = Resources.EditBtn;
            this.imgEdit.Name = "imgEdit";
            this.imgEdit.Width = 60;
            this.imgDelete.HeaderText = "删除";
            this.imgDelete.Image = Resources.DeleteBtn;
            this.imgDelete.Name = "imgDelete";
            this.imgDelete.Width = 60;
            this.PlSearch.Controls.Add(this.panel20);
            this.PlSearch.Controls.Add(this.panel21);
            this.PlSearch.Controls.Add(this.panel18);
            this.PlSearch.Controls.Add(this.panel19);
            this.PlSearch.Controls.Add(this.panel16);
            this.PlSearch.Controls.Add(this.panel17);
            this.PlSearch.Controls.Add(this.panel22);
            this.PlSearch.Controls.Add(this.panel23);
            this.PlSearch.Dock = DockStyle.Top;
            this.PlSearch.Location = new Point(0, 0x2a);
            this.PlSearch.Name = "PlSearch";
            this.PlSearch.Size = new Size(0x367, 0x1b);
            this.PlSearch.TabIndex = 6;
            this.PlSearch.Visible = false;
            this.panel20.Controls.Add(this.drp_GuestType);
            this.panel20.Dock = DockStyle.Left;
            this.panel20.Location = new Point(0x2ca, 0);
            this.panel20.Name = "panel20";
            this.panel20.Size = new Size(0x92, 0x1b);
            this.panel20.TabIndex = 13;
            this.drp_GuestType.FormattingEnabled = true;
            this.drp_GuestType.Items.AddRange(new object[] { "请选择", "个人", "公司" });
            this.drp_GuestType.Location = new Point(3, 2);
            this.drp_GuestType.Name = "drp_GuestType";
            this.drp_GuestType.Size = new Size(140, 20);
            this.drp_GuestType.TabIndex = 0;
            this.panel21.Controls.Add(this.lbl_GuestType);
            this.panel21.Dock = DockStyle.Left;
            this.panel21.Location = new Point(0x285, 0);
            this.panel21.Name = "panel21";
            this.panel21.Size = new Size(0x45, 0x1b);
            this.panel21.TabIndex = 12;
            this.lbl_GuestType.AutoSize = true;
            this.lbl_GuestType.Location = new Point(5, 6);
            this.lbl_GuestType.Name = "lbl_GuestType";
            this.lbl_GuestType.Size = new Size(0x3b, 12);
            this.lbl_GuestType.TabIndex = 0;
            this.lbl_GuestType.Text = "客户类型:";
            this.panel18.Controls.Add(this.drp_GuestGrade);
            this.panel18.Dock = DockStyle.Left;
            this.panel18.Location = new Point(0x1f3, 0);
            this.panel18.Name = "panel18";
            this.panel18.Size = new Size(0x92, 0x1b);
            this.panel18.TabIndex = 11;
            this.drp_GuestGrade.FormattingEnabled = true;
            this.drp_GuestGrade.Location = new Point(3, 2);
            this.drp_GuestGrade.Name = "drp_GuestGrade";
            this.drp_GuestGrade.Size = new Size(140, 20);
            this.drp_GuestGrade.TabIndex = 0;
            this.panel19.Controls.Add(this.lbl_GuestGradeType);
            this.panel19.Dock = DockStyle.Left;
            this.panel19.Location = new Point(430, 0);
            this.panel19.Name = "panel19";
            this.panel19.Size = new Size(0x45, 0x1b);
            this.panel19.TabIndex = 10;
            this.lbl_GuestGradeType.AutoSize = true;
            this.lbl_GuestGradeType.Location = new Point(5, 6);
            this.lbl_GuestGradeType.Name = "lbl_GuestGradeType";
            this.lbl_GuestGradeType.Size = new Size(0x3b, 12);
            this.lbl_GuestGradeType.TabIndex = 0;
            this.lbl_GuestGradeType.Text = "折扣类型:";
            this.panel16.Controls.Add(this.txt_Moble);
            this.panel16.Dock = DockStyle.Left;
            this.panel16.Location = new Point(0x11c, 0);
            this.panel16.Name = "panel16";
            this.panel16.Size = new Size(0x92, 0x1b);
            this.panel16.TabIndex = 9;
            this.txt_Moble.Location = new Point(5, 2);
            this.txt_Moble.Name = "txt_Moble";
            this.txt_Moble.Size = new Size(0x89, 0x15);
            this.txt_Moble.TabIndex = 0;
            this.panel17.Controls.Add(this.lbl_Moble);
            this.panel17.Dock = DockStyle.Left;
            this.panel17.Location = new Point(0xd7, 0);
            this.panel17.Name = "panel17";
            this.panel17.Size = new Size(0x45, 0x1b);
            this.panel17.TabIndex = 8;
            this.lbl_Moble.AutoSize = true;
            this.lbl_Moble.Location = new Point(5, 6);
            this.lbl_Moble.Name = "lbl_Moble";
            this.lbl_Moble.Size = new Size(0x3b, 12);
            this.lbl_Moble.TabIndex = 0;
            this.lbl_Moble.Text = "客户名称:";
            this.panel22.Controls.Add(this.txt_GuestName);
            this.panel22.Dock = DockStyle.Left;
            this.panel22.Location = new Point(0x45, 0);
            this.panel22.Name = "panel22";
            this.panel22.Size = new Size(0x92, 0x1b);
            this.panel22.TabIndex = 7;
            this.txt_GuestName.Location = new Point(5, 2);
            this.txt_GuestName.Name = "txt_GuestName";
            this.txt_GuestName.Size = new Size(0x89, 0x15);
            this.txt_GuestName.TabIndex = 0;
            this.panel23.Controls.Add(this.lbl_GuestName);
            this.panel23.Dock = DockStyle.Left;
            this.panel23.Location = new Point(0, 0);
            this.panel23.Name = "panel23";
            this.panel23.Size = new Size(0x45, 0x1b);
            this.panel23.TabIndex = 6;
            this.lbl_GuestName.AutoSize = true;
            this.lbl_GuestName.Location = new Point(5, 6);
            this.lbl_GuestName.Name = "lbl_GuestName";
            this.lbl_GuestName.Size = new Size(0x3b, 12);
            this.lbl_GuestName.TabIndex = 0;
            this.lbl_GuestName.Text = "客户名称:";
            this.panel13.Dock = DockStyle.Bottom;
            this.panel13.Location = new Point(0, 0x1a2);
            this.panel13.Name = "panel13";
            this.panel13.Size = new Size(0x367, 10);
            this.panel13.TabIndex = 5;
            this.panel10.BackColor = Color.FromArgb(0xca, 0xc9, 0xce);
            this.panel10.Controls.Add(this.panel12);
            this.panel10.Controls.Add(this.panel11);
            this.panel10.Dock = DockStyle.Bottom;
            this.panel10.Location = new Point(0, 0x1ac);
            this.panel10.Name = "panel10";
            this.panel10.Size = new Size(0x367, 0x1a);
            this.panel10.TabIndex = 4;
            this.panel12.Controls.Add(this.lblWhere);
            this.panel12.Dock = DockStyle.Fill;
            this.panel12.Location = new Point(0, 0);
            this.panel12.Name = "panel12";
            this.panel12.Size = new Size(0x1aa, 0x1a);
            this.panel12.TabIndex = 1;
            this.lblWhere.AutoSize = true;
            this.lblWhere.Dock = DockStyle.Right;
            this.lblWhere.Location = new Point(0x1aa, 0);
            this.lblWhere.Name = "lblWhere";
            this.lblWhere.Size = new Size(0, 12);
            this.lblWhere.TabIndex = 0;
            this.lblWhere.Visible = false;
            this.panel11.Controls.Add(this.navigator_Page);
            this.panel11.Dock = DockStyle.Right;
            this.panel11.Location = new Point(0x1aa, 0);
            this.panel11.Name = "panel11";
            this.panel11.Size = new Size(0x1bd, 0x1a);
            this.panel11.TabIndex = 0;
            this.navigator_Page.Dock = DockStyle.Bottom;
            this.navigator_Page.Location = new Point(0, 8);
            this.navigator_Page.Name = "navigator_Page";
            this.navigator_Page.PageSize = 20;
            this.navigator_Page.RowCount = 0;
            this.navigator_Page.Size = new Size(0x1bd, 0x12);
            this.navigator_Page.TabIndex = 0;
            this.navigator_Page.OnLoadViewStatus += new Navigator.LoadViewStatusHandler(this.navigator_Page_OnLoadViewStatus);
            this.panel91.Dock = DockStyle.Bottom;
            this.panel91.Location = new Point(0, 0x1c6);
            this.panel91.Name = "panel91";
            this.panel91.Size = new Size(0x367, 5);
            this.panel91.TabIndex = 3;
            this.panel101.BackColor = Color.WhiteSmoke;
            this.panel101.Controls.Add(this.btn_Close);
            this.panel101.Controls.Add(this.btn_Select);
            this.panel101.Dock = DockStyle.Bottom;
            this.panel101.Location = new Point(0, 0x1cb);
            this.panel101.Name = "panel101";
            this.panel101.Size = new Size(0x367, 0x1c);
            this.panel101.TabIndex = 3;
            this.btn_Close.Location = new Point(0x206, 2);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 3;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.btn_Select.Location = new Point(0x115, 2);
            this.btn_Select.Name = "btn_Select";
            this.btn_Select.Size = new Size(0x4b, 0x17);
            this.btn_Select.TabIndex = 2;
            this.btn_Select.Text = "选 择";
            this.btn_Select.UseVisualStyleBackColor = true;
            this.btn_Select.Click += new EventHandler(this.btn_Select_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x1e7);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(0x367, 5);
            this.panel9.TabIndex = 3;
            this.panel8.Dock = DockStyle.Top;
            this.panel8.Location = new Point(0, 0x22);
            this.panel8.Name = "panel8";
            this.panel8.Size = new Size(0x367, 8);
            this.panel8.TabIndex = 2;
            this.pan_TopJianGe.Dock = DockStyle.Top;
            this.pan_TopJianGe.Location = new Point(0, 0);
            this.pan_TopJianGe.Name = "pan_TopJianGe";
            this.pan_TopJianGe.Size = new Size(0x367, 8);
            this.pan_TopJianGe.TabIndex = 0;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x371, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x1ec);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x1ec);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x1f6);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x37b, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x37b, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x200);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(0x37b, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x37c, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x201);
            this.pan_DockRight.TabIndex = 1;
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x201);
            this.pan_DockLeft.TabIndex = 0;
            this.label1.AutoSize = true;
            this.label1.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.label1.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.label1.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.label1.Location = new Point(6, 8);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x3f, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "选择客人";
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x37d, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.label1);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x359, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x378, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x37d, 0x221);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.Name = "FrmGuestSelect";
            base.ShowInTaskbar = false;
            this.Text = "FrmChain";
            base.Load += new EventHandler(this.FrmGuestList_Load);
            this.panel1.ResumeLayout(false);
            this.panel7.ResumeLayout(false);
            this.panel6.ResumeLayout(false);
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridList).EndInit();
            this.PlSearch.ResumeLayout(false);
            this.panel20.ResumeLayout(false);
            this.panel21.ResumeLayout(false);
            this.panel21.PerformLayout();
            this.panel18.ResumeLayout(false);
            this.panel19.ResumeLayout(false);
            this.panel19.PerformLayout();
            this.panel16.ResumeLayout(false);
            this.panel16.PerformLayout();
            this.panel17.ResumeLayout(false);
            this.panel17.PerformLayout();
            this.panel22.ResumeLayout(false);
            this.panel22.PerformLayout();
            this.panel23.ResumeLayout(false);
            this.panel23.PerformLayout();
            this.panel10.ResumeLayout(false);
            this.panel12.ResumeLayout(false);
            this.panel12.PerformLayout();
            this.panel11.ResumeLayout(false);
            this.panel101.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void InitPage()
        {
            this.navigator_Page.PageSize = PublicAppliction.PageCount;
            this.navigator_Page.DataContainer = this.DataGridList;
            this.navigator_Page.Init();
        }

        private void navigator_Page_OnLoadViewStatus()
        {
            this.DataGrid_bind();
            this.navigator_Page.PageSize = PublicAppliction.PageCount;
            this.navigator_Page.DataContainer = this.DataGridList;
            this.navigator_Page.DataBind();
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            try
            {
                int index;
                if (keyData == Keys.Return)
                {
                    this.btn_Select_Click(null, null);
                }
                if (keyData == Keys.Up)
                {
                    index = this.DataGridList.CurrentRow.Index;
                    if (index > 0)
                    {
                        this.DataGridList.Rows[index - 1].Selected = true;
                    }
                }
                if (keyData == Keys.Down)
                {
                    index = this.DataGridList.CurrentRow.Index;
                    if (index < this.DataGridList.Rows.Count)
                    {
                        this.DataGridList.Rows[index + 1].Selected = true;
                    }
                }
            }
            catch (Exception)
            {
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
    }
}

